package com.demo.utils;



public class TypeCheckUtils {

    public static <T> boolean isInstanceOfType(Object obj, Class<T> type) {
        return type != null && type.isInstance(obj);
    }


    public static boolean isInteger(String str) {
        if (str == null || str.isEmpty()) {
            return false;
        }
        try {
            Integer.parseInt(str);
            return true;
        }catch (NumberFormatException e) {
            return false;
        }
    }

//    public static void main(String[] args) {
//        System.out.println(isInteger("123"));
//    }

}
